package com.otaku.producer.controller;

import com.otaku.producer.rabbitMq.FanoutProducer;
import com.otaku.producer.rabbitMq.config.FanoutConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProducerController {
    @Autowired
    private FanoutProducer fanoutProducer;

    @RequestMapping("/sendFanout")
    public String sendFanout(String queueName) {
        fanoutProducer.send(queueName);
        return "success";
    }

    @RequestMapping("/sendMail")
    public String sendMail() {
        fanoutProducer.send("fanout_email_queue");
        return "success";
    }

    @RequestMapping("/sendSms")
    public String sendSms() {
        fanoutProducer.send("fanout_sms_queue");
        return "success";
    }

}
